package com.smart.persistence.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;



@Entity
@Table(name = "T_Book_Room")
public class BookRoom {
	
	@Id
	@Column(name = "id_book_room")
	@TableGenerator(name = "BOOK_ROOM_GEN", allocationSize = 1, initialValue = 1, table = "T_ID", pkColumnName = "key", 
			valueColumnName = "valor", pkColumnValue = "ID_BOOK_ROOM")
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "BOOK_ROOM_GEN")
	private long id;
	
	
	private String hostFirstName;
	
	private String hostLastName;
	
	@Temporal(value = TemporalType.DATE)
	private Date checkIn;
	
	
	@Temporal(value = TemporalType.DATE)
	private Date checkOut;
	
	private int amountAdults;
	
	private int amountchildren;
	
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "id_room", nullable = false)    
	private Room room;
	
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "id_book_hotel", nullable = false)    
	private BookHotel bookHotel;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getHostFirstName() {
		return hostFirstName;
	}

	public void setHostFirstName(String hostFirstName) {
		this.hostFirstName = hostFirstName;
	}

	public String getHostLastName() {
		return hostLastName;
	}

	public void setHostLastName(String hostLastName) {
		this.hostLastName = hostLastName;
	}

	public Date getCheckIn() {
		return checkIn;
	}

	public void setCheckIn(Date checkIn) {
		this.checkIn = checkIn;
	}

	public Date getCheckOut() {
		return checkOut;
	}

	public void setCheckOut(Date checkOut) {
		this.checkOut = checkOut;
	}

	public Room getRoom() {
		return room;
	}

	public void setRoom(Room room) {
		this.room = room;
	}

	public int getAmountAdults() {
		return amountAdults;
	}

	public void setAmountAdults(int amountAdults) {
		this.amountAdults = amountAdults;
	}

	public int getAmountchildren() {
		return amountchildren;
	}

	public void setAmountchildren(int amountchildren) {
		this.amountchildren = amountchildren;
	}

	public BookHotel getBookHotel() {
		return bookHotel;
	}

	public void setBookHotel(BookHotel bookHotel) {
		this.bookHotel = bookHotel;
	}

	
	
}
